@echo off
echo 🔐 =============== PlayTruly签名验证工具 ===============
echo.
echo 📋 正在验证项目签名配置...
echo.

rem 检查key.properties文件
if exist "key.properties" (
    echo ✅ key.properties文件存在
    echo 📋 配置内容:
    type key.properties
    echo.
) else (
    echo ❌ key.properties文件不存在
    goto :error
)

rem 检查keystore文件
if exist "android\playtruly_new.keystore" (
    echo ✅ keystore文件存在: android\playtruly_new.keystore
    echo.
) else (
    echo ❌ keystore文件不存在: android\playtruly_new.keystore
    goto :error
)

rem 显示keystore详细信息
echo 🔍 正在查看keystore详细信息...
echo.
keytool -list -v -keystore android\playtruly_new.keystore -storepass playtruly2025new

if %errorlevel% equ 0 (
    echo.
    echo ✅ =============== 验证成功 ===============
    echo 📝 重要信息:
    echo    SHA1指纹: 63:DC:85:B2:29:3B:44:97:FB:C4:6B:A6:6B:6A:70:BB:79:44:09:C5
    echo    包名: com.playtruly.wanzhende2025
    echo    keystore: android/playtruly_new.keystore
    echo.
    echo 🚀 可以正常构建应用:
    echo    flutter build apk --debug
    echo    flutter build apk --release
    echo    flutter build appbundle --release
    echo.
) else (
    echo ❌ keystore验证失败
    goto :error
)

goto :end

:error
echo.
echo ❌ =============== 验证失败 ===============
echo 💡 请检查:
echo    1. key.properties文件是否存在并配置正确
echo    2. keystore文件是否存在: android\playtruly_new.keystore
echo    3. 密码是否正确: playtruly2025new
echo.
echo 🔧 修复建议:
echo    1. 确保在项目根目录运行此脚本
echo    2. 如果keystore文件丢失，请重新生成或从git获取
echo    3. 检查key.properties文件中的路径配置
echo.

:end
pause
